package com.tronsis.library.imageloader;

import android.content.Context;
import android.support.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.AppGlideModule;

import java.io.InputStream;

import okhttp3.OkHttpClient;

/**
 * 自定义GlideModule
 * @author scofield@tronsis.com
 * @date 2018/6/6
 */
@GlideModule
public class MyGlideModule extends AppGlideModule {
    /*@Override
    public void applyOptions(Context context, GlideBuilder builder) {

        // 设置内存缓存最大的大小
       *//* MemorySizeCalculator calculator = new MemorySizeCalculator(mContext);
        int defaultMemoryCacheSize = calculator.getMemoryCacheSize();
        int defaultBitmapPoolSize = calculator.getBitmapPoolSize();

        int customMemoryCacheSize = (int) (1.2 * defaultMemoryCacheSize);
        int customBitmapPoolSize = (int) (1.2 * defaultBitmapPoolSize);

        builder.setMemoryCache(new LruResourceCache(customMemoryCacheSize));
        builder.setBitmapPool(new LruBitmapPool(customBitmapPoolSize));

        // 设置磁盘缓存路径和缓存最大的大小
        int cacheSize200MegaBytes = 209715200; // 200MB
        String downloadDirectoryPath = Environment.getDownloadCacheDirectory().getPath();
        builder.setDiskCache(
                new DiskLruCacheFactory(downloadDirectoryPath, cacheSize200MegaBytes)

        );*//*
    }


    @Override
    public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
        super.registerComponents(context, glide, registry);
    }*/



}
